package string;

import java.util.Arrays;

/**
 * 拆分文件名与后缀名
 */
public class Test2 {
    public static void main(String[] args) {
        String fileName = "image.png";
        String[] data = fileName.split("\\.");
        System.out.println(Arrays.toString(data));
        System.out.println(data[0]);
        System.out.println(data[1]);
    }
}
